package com.itheima.chapter07.object;

public class Demo {
    public static void main(String[] args) {
        Student s = new Student("张三", 23);
        System.out.println(s);//com.itheima.myObject.Student@1540e19d
        System.out.println(s.toString());//com.itheima.myObject.Student@1540e19d
        //toString重写之后控制台：Student{name='张三', age=23}
        Student s1 = new Student("张三", 23);
        System.out.println(s==s1);
        System.out.println(s.equals(s1));//重写equals
    }
}
